#include <algorithm>
#include <cmath>
#include <cstdio>

const int N = 500005;
int n, a[N];
double f[2][N];

void solve1(int l, int r, int L, int R) {
  if (l > r) return;
  int mid = (l + r) >> 1, g = 0;
  double tmp = 0;
  f[0][mid] = a[mid];
  for (register int i = L; i <= std::min(mid, R); ++i) {
    tmp = a[i] + sqrt(mid - i);
    if (tmp > f[0][mid]) f[0][mid] = tmp, g = i;
  }
  if (g == 0) g = mid;
  f[0][mid] -= a[mid];
  solve1(l, mid - 1, L, g);
  solve1(mid + 1, r, g, R);
}

void solve2(int l, int r, int L, int R) {
  if (l > r) return;
  int mid = (l + r) >> 1, g = 0;
  double tmp = 0;
  f[1][mid] = a[mid];
  for (register int i = R; i >= std::max(mid, L); --i) {
    tmp = a[i] + sqrt(i - mid);
    if (tmp > f[1][mid]) f[1][mid] = tmp, g = i;
  }
  if (g == 0) g = mid;
  f[1][mid] -= a[mid];
  solve2(l, mid - 1, L, g);
  solve2(mid + 1, r, g, R);
}

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#else
  freopen("P3515 Lightning Conductor.in", "r", stdin);
  freopen("P3515 Lightning Conductor.out", "w", stdout);
#endif
#endif

  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) { scanf("%d", &a[i]); }
  solve1(1, n, 1, n);
  solve2(1, n, 1, n);
  for (int i = 1; i <= n; ++i) printf("%d\n", (int)ceil(std::max(f[0][i], f[1][i])));
  return 0;
}